<?php
    header("Content-type: text/html; charset=utf-8"); 
    //echo"请解除保险";
    //exit;
    $url = "http://115.159.17.115/InterfaceManager/coreService";
    $postArr = array(
        'user'          =>  '',
        'request_type'  =>  'MD20150008',
        'uuid'         =>  ''
        );
    $xml = '<?xml version="1.0" encoding="UTF-8"?><PACKET><requesthead><user>%s</user><request_type>%s</request_type><uuid>%s</uuid></requesthead><requestbody></requestbody></PACKET>';
    $postXml = vsprintf($xml,$postArr);
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postXml);
    $result = curl_exec($ch);
    curl_close($ch);
    $resultObj = simplexml_load_string( $result );
    //var_dump($resultObj);
    $accessToken = $resultObj->responsebody->accesstoken;
    $expires_s = intval($resultObj->responsebody->expires_su/1000);
    echo $accessToken."<br />";
    echo $expires_s;
    //print_r($post);